<template>
  <div class="message">
    <app-header :back="false" titleContent="论坛" messageTitle="发布论坛"></app-header>
    <ul>
      <li class="split" v-for="(item,index) in weihuData" :key="index">
        <pic-desc v-if="flag" :img="item.img[0]" :content="item.content" :time="item.created_at" :count="`浏览量：${item.reading_amount}`"></pic-desc>
      </li>
    </ul>
    <back-top></back-top>
  </div>
</template>

<script>
import AppHeader from '../header/header'
import picDesc from '../common/picDesc'
import backTop from '../common/backTop'
import {getWeiHuData} from '../../api/supervisor'
const SUCCESS = 200
export default {
  data () {
    return {
      weihuData: [],
      flag: false
    }
  },
  components: {
    AppHeader,
    picDesc,
    backTop
  },
  created () {
    this._getWeiHuData()
  },
  methods: {
    _getWeiHuData () {
      getWeiHuData().then(res => {
        if (res.code === SUCCESS) {
          this.weihuData = res.data.data
          this.flag = true
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
  .message{
    .split{
      &:last-child{
        .pic-desc {
          border-bottom: 1px solid transparent;
        }
      }
    }
  }
</style>